package com.example.diyview;

import androidx.appcompat.app.AppCompatActivity;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getWindow().setBackgroundDrawable(null);
        colorText a=findViewById(R.id.rnm);
//        a.setNumber(10000);
        ValueAnimator valueAnimator = ObjectAnimator.ofFloat(0,200);
        valueAnimator.setDuration(2000);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                float now = (float) animation.getAnimatedValue();
                a.setNow((int)now%50);
            }
        });
        valueAnimator.start();
    }
}